package com.zhouyu;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.SpringApplicationRunListener;
import org.springframework.context.ConfigurableApplicationContext;

import java.time.Duration;

/**
 * @Author kuangliming
 * @Date 2024/1/17 22:35
 * @Description
 **/
public class SunnySpringApplicationRunListener implements SpringApplicationRunListener{
	private final SpringApplication application;
	private final String[] args;
	public SunnySpringApplicationRunListener(SpringApplication sa, String[] args) {
		this.application = sa;
		this.args = args;
	}


	/**
	 *
	 * SpringBoot在启动阶段，会调用这个扩展点，  SpringApplicationRunListener里面有很多方法， 在不同的阶段回调不同的方法触发
	 *
	 * @param context the application context.
	 * @param timeTaken the time taken to start the application or {@code null} if unknown
	 */


	@Override
	public void started(ConfigurableApplicationContext context, Duration timeTaken) {
		System.out.println("容器启动成功！@！！！！！！！！！！！");
//		SpringApplicationRunListener.super.started(context, timeTaken);
	}
}
